import { _fetch } from '../../utils/request'
// 获取 城市 和 选题
export function getRegion () {
  return _fetch({
    url: '/interview/filters',
    needToken: true
  })
}

// 获取 对应城市 选题

export function getQuestions (type, city) {
  return _fetch({
    url: '/interview/questions',
    method: 'GET',
    params: {
      city: city,
      type: type
    },
    needToken: true
  })
}
// 下一题
export function cheangeQues (id) {
  return _fetch({
    url: `/questions/${id}`,
    needToken: true
  })
}
// 提交答案
export function nextQ ({ id, singleAnswer, multipleAnswer }) {
  return _fetch({
    url: '/questions/submit',
    method: 'POST',
    data: {
      id,
      singleAnswer,
      multipleAnswer
    },
    needToken: true
  })
}

// 收藏
export function toCollect (id) {
  return _fetch({
    url: '/questions/collect',
    method: 'post',
    data: {
      id: id
    },
    needToken: true
  })
}

// 评论 反馈
export function feedBack (content, question) {
  return _fetch({
    url: '/questions/comment',
    method: 'post',
    data: {
      content: content,
      question: question
    },
    needToken: true
  })
}
